/**
  ******************************************************************************
  * @file    Project/Application/Config/ST/stm32f10x_conf.c 
  * @author  Feirui_Joe
  * @version V0.1
  * @date    07/26/2010
  * @brief   Library extend file.
  ******************************************************************************
  * @copy
  *
  * <h2><center>&copy; COPYRIGHT 2010 Feirui</center></h2>
  */ 

#include  <stdio.h>
#include  <stm32f10x.h>



#ifdef __MISC_H

/**
  * @brief  Deinitializes the NVIC peripheral registers to their default
  *         reset values.
  * @param  none
  * @retval None
  */
void NVIC_DeInit(void)
{
  uint32_t index = 0;
  
  for(index = 0; index < 8; index++)
  {
     NVIC->ICER[index] = 0xFFFFFFFF;
  }
  
  for(index = 0; index < 8; index++)
  {
     NVIC->ICPR[index] = 0xFFFFFFFF;
  }
    
  for(index = 0; index < 240; index++)
  {
     NVIC->IP[index] = 0;
  } 
}


/**
  * @brief  Deinitializes the SCB peripheral registers to their default
  *         reset values.
  * @param  none
  * @retval None
  */
void NVIC_SCBDeInit(void)
{
  uint32_t index = 0x00;
  
  SCB->ICSR = 0x0A000000;
  SCB->VTOR = 0x00000000;
  SCB->AIRCR = AIRCR_VECTKEY_MASK;
  SCB->SCR = 0x00000000;
  SCB->CCR = 0x00000000;
  for(index = 0; index < 12; index++)
  {
     SCB->SHP[index] = 0;
  }
  SCB->SHCSR = 0x00000000;
  SCB->CFSR = 0xFFFFFFFF;
  SCB->HFSR = 0xFFFFFFFF;
  SCB->DFSR = 0xFFFFFFFF;
}
#endif




#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{ 
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  
  printf("Wrong parameters value: file %s on line %d\r\n", file, line);
  while (1)
  {
  }
}
#endif

/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/